using System;

namespace Kaleida.ServiceMonitor.Framework.Responses
{
    public class HttpOperationResponse : ITimedEvent, IStringContainer
    {
        private readonly string content;
        private readonly TimeSpan timeTaken;

        public HttpOperationResponse(string content, TimeSpan timeTaken)
        {
            this.content = content;
            this.timeTaken = timeTaken;
        }

        public string Content
        {
            get { return content; }
        }

        public TimeSpan TimeTaken
        {
            get { return timeTaken; }
        }

        public override string ToString()
        {
            return string.Format("Received {0} characters after {1} ms", content.Length, timeTaken.TotalMilliseconds);
        }
    }
}